﻿using WWLauncher.Constant;
using WWLauncher.Util;
using System;
using System.ComponentModel;

namespace WWLauncher.ViewModel
{
    [Serializable]
    public class GradientBGParamViewModel : INotifyPropertyChanged
    {
        private string color1;
        private string color2;
        private string _textColor;
        private string name;


        public GradientBGParamViewModel(string name, string color1, string color2, string textColor)
        {
            this.name = name;
            this.color1 = color1;
            this.color2 = color2;
            this._textColor = textColor;
        }


        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
                OnPropertyChanged("Name");
            }
        }

        public string Color1
        {
            get
            {
                return color1;
            }
            set
            {
                color1 = value;
                OnPropertyChanged("Color1");
            }
        }

        public string Color2
        {
            get
            {
                return color2;
            }
            set
            {
                color2 = value;
                OnPropertyChanged("Color2");
            }
        }

        public string TextColor
        {
            get
            {
                return _textColor;
            }
            set
            {
                _textColor = value;
                OnPropertyChanged("TextColor");
            }
        }

        [field: NonSerialized]
        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

    }
}
